﻿@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentComponentBase

<div id="@Id" class="@ClassValue" style="@StyleValue" @attributes="@AdditionalAttributes" position="@TextPosition.ToAttributeValue()">
    <div class="initials" @onclick="@OnClick" style="@(OnClick.HasDelegate ? $"cursor: pointer;" : null)">
        <FluentPresenceBadge Status="@Status" Size="@StatusSize" StatusTitle="@StatusTitle">
            <div style="display: table-cell; vertical-align: middle; @GetImageMinSizeStyle()">
                @if (string.IsNullOrEmpty(Image))
                {
                    @(Initials ?? GetDefaultInitials())
                }
                else
                {
                    <img src="@Image" alt="@Name" title="@Name" style="@GetImageMaxSizeStyle()" />
                }
            </div>
        </FluentPresenceBadge>
    </div>
    @if (ChildContent is not null || !String.IsNullOrEmpty(Name))
    {
        <div class="name" @onclick="@OnClick" style="@(OnClick.HasDelegate ? $"cursor: pointer;" : null)">
            @if (ChildContent is null)
            {
                @Name
            }
            else
            {
                @ChildContent
            }
        </div>
    }
    @if (OnDismissClick.HasDelegate)
    {
        <div class="close">
            <FluentIcon Value="@(new CoreIcons.Regular.Size24.Dismiss())" Width="12px" Title="@DismissTitle" OnClick="OnDismissClick" />
        </div>
    }
</div>
